package com.atguigu.springboot.mapper;

import com.atguigu.springboot.bean.Department;
import org.apache.ibatis.annotations.*;

/**
 * 指定这是一个操作数据库的 mapper
 *
 * @author admin
 */
// @Mapper
public interface DepartmentMapper {

    @Select("select * from department where id = #{id} ")
    public Department getDeptById(Integer id);

    @Delete("delete from department where id = #{id} ")
    public int DeleteDeptById(Integer id);

    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into department(departmentName) values (#{departmentName} )")
    public int insertDept(Department department);

    @Update("update department set departmentName = #{departmentName} where id = #{id} ")
    public int updateDept(Department department);
}
